using System.IO;

namespace LuceneSearch.Indexer
{
    public class DirectoryTraverser
    {
        public void Traverse(DirectoryInfo dir, IDirectoryVisitor visitor)
        {
            visitor.Visit(dir);

            foreach (var subDir in dir.GetDirectories())
            {
                Traverse(subDir, visitor);
            }
        }
    }
}